//
//  SRUserBLEService.m
//  SportRing
//
//  Created by Apple on 14/11/11.
//  Copyright (c) 2014年 HotOne. All rights reserved.
//

#import "SRUserBLEService.h"
#import "BlueToothLib.h"

@implementation SRUserBLEService

+ (RACSignal *)updateMe:(SRMe *)me
{
    RACSubject * subject = [RACSubject subject];
    
    user_info_t userInfo;
    userInfo.sex = me.gender.intValue == SRGenderMale ? 0x00 : 0x01;
    userInfo.stature = me.height.floatValue;
    userInfo.weight = me.weight.floatValue;
    userInfo.born = [me.birthday intValue];
    
    [BlueToothLib userinfoSetting:&userInfo withBlock:^(BOOL isTimeOut) {
        [subject sendNext:nil];
    }];
    
    return subject;
}

@end
